import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import React, { PureComponent } from 'react';
import { Radio, InputNumber, List } from 'antd';
var Group = Radio.Group;

var Year = /*#__PURE__*/function (_PureComponent) {
  _inherits(Year, _PureComponent);

  var _super = _createSuper(Year);

  function Year() {
    _classCallCheck(this, Year);

    return _super.apply(this, arguments);
  }

  _createClass(Year, [{
    key: "changeParams",
    value: function changeParams(type, value) {
      var state = _objectSpread({}, this.props.year);

      state[type] = value;
      this.props.onChange(state);
    }
  }, {
    key: "render",
    value: function render() {
      var _this = this;

      var _this$props$year = this.props.year,
          type = _this$props$year.type,
          start = _this$props$year.start,
          end = _this$props$year.end;
      return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Group, {
        value: type,
        onChange: function onChange(e) {
          _this.changeParams('type', e.target.value);
        },
        defaultValue: ""
      }, /*#__PURE__*/React.createElement(List, {
        size: "small",
        bordered: true
      }, /*#__PURE__*/React.createElement(List.Item, null, /*#__PURE__*/React.createElement(Radio, {
        value: ""
      }, "\u4E0D\u6307\u5B9A")), /*#__PURE__*/React.createElement(List.Item, null, /*#__PURE__*/React.createElement(Radio, {
        value: "*"
      }, "\u6BCF\u5E74")), /*#__PURE__*/React.createElement(List.Item, null, /*#__PURE__*/React.createElement(Radio, {
        value: "period"
      }, "\u5468\u671F"), /*#__PURE__*/React.createElement(InputNumber, {
        min: 0,
        defaultValue: 2018,
        value: start,
        placeholder: "\u5E74",
        onChange: function onChange(value) {
          _this.changeParams('start', value);
        }
      }), "\xA0-\xA0", /*#__PURE__*/React.createElement(InputNumber, {
        min: 0,
        defaultValue: 2019,
        value: end,
        placeholder: "\u5E74",
        onChange: function onChange(value) {
          _this.changeParams('end', value);
        }
      })))));
    }
  }]);

  return Year;
}(PureComponent);

export { Year as default };